<template>
    <!-- <el-dialog v-if="dialogVisible" title="视频" :visible.sync="dialogVisible" @close="resetForm()" :fullscreen="true" width="400px">
        <div class="video_box">
            <img :src="url+'&x-oss-process=video/snapshot,t_0,f_jpg'" alt="" class="material_img_big">
            <video id="media" :src="url" autoplay preload controls width="100%" height="100%"></video>
        </div>
        <span slot="footer">
            
        </span>
        <span slot="title">
            
        </span>
    </el-dialog> -->
    <div class="video_play" v-if="dialogVisible">
        <span class="close_video" @click="resetForm"></span>
        <video id="media" :src="url" autoplay preload controls></video>
    </div>
</template>

<script>
export default {
    name: "",
    data() {
        return {
            loading: false,
            dialogVisible: false,
            url: "",
        };
    },
    created() {
        this.$bus.on("playVideo", (value) => {
            this.dialogVisible = value.dialogVsb;
            this.url = value.url;
        });
    },
    methods: {
        // 关闭重置表单
        resetForm() {
            this.dialogVisible = false;
            this.url = "";
        },
    },
    components: {},
};
</script>


<style scoped>
.video_box {
    position: relative;
    height: 500px;
    background-color: rgba(0, 0, 0, 0.2);
}
.close_video{
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1
}
#media {
    position: absolute;
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px;
    max-height: 100%;
    max-width: 100%;
    margin: auto;
    z-index: 2;
}
.video_play {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 9999;
    top: 0;
    left: 0;
}
</style>
